package protocal;


import java.io.Serializable;

/*
 * protocol
 * fromName:message sender;
 * toName:message receiver
 * messageType: LONGIN   user login
 * 				LONGOUT  user logout
 * 				LIST  "\" Cutting operator
 * 				MESSAGE chat message
 * 				SHAKE   windows shake
 * 			
 */



public class DataPackage implements Serializable{
	
	public enum MessageType{
		LOGIN,LOGOUT,LIST,MESSAGE,SHAKE
	}
	
	public DataPackage(){}
	public DataPackage(String fromeName, String toName,
			MessageType messageType, String messageData, long time) {
		super();
		this.fromeName = fromeName;
		this.toName = toName;
		this.messageType = messageType;
		this.messageData = messageData;
		this.time = time;
	}
	@Override
	public String toString() {
		return "DataPackage [fromeName=" + fromeName + ", toName=" + toName
				+ ", messageType=" + messageType + ", messageData="
				+ messageData + ", time=" + time + "]";
	}
	private static final long serialVersionUID = 1L;
	private String fromeName;
	private String toName;
	private MessageType messageType;
	private String messageData;
	private long time;
	
	public String getFromeName() {
		return fromeName;
	}
	public void setFromeName(String fromeName) {
		this.fromeName = fromeName;
	}
	public String getToName() {
		return toName;
	}
	public void setToName(String toName) {
		this.toName = toName;
	}
	public MessageType getMessageType() {
		return messageType;
	}
	public void setMessageType(MessageType messageType) {
		this.messageType = messageType;
	}
	public String getMessageData() {
		return messageData;
	}
	public void setMessageData(String messageData) {
		this.messageData = messageData;
	}
	public long getTime() {
		return time;
	}
	public void setTime(long time) {
		this.time = time;
	}
	
	
}



